package gcu.module.notice.dao;

import gcu.module.notice.dao.mapper.NoticeMapper;
import gcu.module.notice.daomain.Notice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by haol on 2016/9/29.
 */
@Repository
public class NoticeDao {
      @Autowired
      private NoticeMapper mapper;

      public Notice getNotice(){
            try{
                  return mapper.get();
            }catch (Exception e){
                  e.printStackTrace();
                  return null;
            }
      }
      public void addNotice(Notice notice){
            try{
                  mapper.addNotice(notice);
            }catch (Exception e){
                  e.printStackTrace();
            }
      }
}
